{% extends 'dish/dish_base.html' %}
{% block title %}
    菜品管理首页
{% endblock %}
{% block aside %}
    {{ super() }}
{% endblock %}
{% block content %}
    <div>
        <ol class="breadcrumb">
          <li><a href="#">首页</a></li>
          <li><a href="#">菜管理</a></li>
          <li class="active">菜管理首页</li>
        </ol>
            <form class="form-horizontal" action="{{url_for("dish.index_by_dish_type")}}">
                 <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">菜品名:</label>
                    <div class="col-sm-6">
                        <label>
                            <select class="form-control" name="dish_type_no">
                                {% for dish_type in dish_types %}
                                    <option value="{{ dish_type.dish_type_no }}">{{ dish_type.dish_type_name }}</option>
                                {% endfor %}
                              </select>
                        </label>
                    </div>
                    <button type="submit" class="btn btn-primary">查询</button>
                  </div>
            </form>
        <table class="table">
            <tr>
                <td>序号</td>
                <td>菜名</td>
                <td>价格</td>
                <td>菜品种类</td>
            </tr>
            {% for dish in dishes %}
                <tr>
                    <td>{{ loop.index }}</td>
                    <td>{{ dish.dish_name }}</td>
                    <td>{{ dish.price }}</td>
                    <td>{{ dish.dishType.dish_type_name }}</td>
                </tr>
            {% endfor %}
        </table>
    </div>
{% endblock %}